<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<style>
.pageFormContent label {
	width: 200px;
}
</style>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/weekly/weekly/list" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td><label>部门：</label> <%-- <input size="30" placeholder="请输入订单编号" name="org2.onum" type="text" value="${requestScope.dwzPageBean.countResultMap.onum}" />  --%> <select name="did" class="combox">
							<option value="">请选择</option>
							<c:forEach items="${requestScope.departments}" var="item">
								<option value="${item.id}" ${item.id == requestScope.dwzPageBean.countResultMap.did?'selected':''}>${item.name }</option>
							</c:forEach>
					</select></td>
					<td><label>制表人：</label> <select name="eid" class="combox">
							<option value="">请选择</option>
							<c:forEach items="${requestScope.employees}" var="item">
								<option value="${item.employeeId}" ${item.employeeId == requestScope.dwzPageBean.countResultMap.eid?'selected':''}>${item.employeeName }</option>
							</c:forEach>
					</select></td>
					<td><label>制表时间： </label><input name="startTime" class="date textInput readonly" readonly="true" type="text" value="${requestScope.dwzPageBean.countResultMap.startTime}" placeholder="请选择添加时间" style="margin-right: 5px;"> 至 <input style="margin-left: 5px;" name="endTime" class="date textInput readonly" readonly="true" minDate="" type="text" value="${requestScope.dwzPageBean.countResultMap.endTime}" placeholder="请选择添加时间"></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="/weekly/weekly/export">
				<li><a href="${pageContext.request.contextPath}/weekly/weekly/export" target="dwzExport" targetType="navTab" title="是要导出这些记录吗?" class="icon"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/weekly/weekly/toInsert">
				<li><a class="add" onclick="toWeekly('${requestScope.merchantEmployees.dmid}','${pageContext.request.contextPath}/weekly/weekly/toInsert','添加')" href="javascript:;"><span>添加</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/weekly/weekly/delete">
				<li><a class="delete" href="${pageContext.request.contextPath}/weekly/weekly/delete" rel="id" target="selectedTodo" title="确定要删除吗？" warn="请最小选择一条记录" mask="true"><span>批量删除</span></a></li>
			</shiro:hasPermission>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="id" class="checkboxCtrl"></th>
				<th orderField="dname" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'dname'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>部门</th>
				<th orderField="ename" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'ename'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>制表人</th>
				<th orderField="tltm" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'tltm'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>制表时间</th>
				<th width="130" orderField="cpld" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'cpld'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>本周工作总结-已完成</th>
				<th width="130" orderField="unfs" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'unfs'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>本周工作总结-未完成</th>
				<th width="150" orderField="focus" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'focus'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>下周工作计划-重点工作</th>
				<th width="150" orderField="coor" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'coor'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>下周工作计划-需要配合的工作</th>
				<th width="150" orderField="othr" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'othr'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>下周工作计划-其他工作</th>
				<th width="150" orderField="remk"  width="150" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'remk'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>备注</th>
				<!-- <th>当操作人为null时，表示自动录入</th>
				<th>添加时间</th>
				<th>是否删除：0-未删除、1-已删除、2-不能删除</th> -->
				<th width="240" >操作</th>
			</tr>
		</thead>
		<tbody>

			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
					<tr ondblclick="openDetails(this)" target="dialog" href="${pageContext.request.contextPath}/weekly/weekly/details?id=${record.id}" title="详情">
						<td><c:if test="${record.del!=3}">
								<c:if test="${record.overdue <= 7}">
									<input name="id" value="${record.id}" type="checkbox">
								</c:if>
							</c:if></td>
						<td>${record.dname}</td>
						<td>${record.ename}</td>
						<td><fmt:formatDate value="${record.tltm}" pattern="yyyy-MM-dd" /></td>
						<td>${record.cpld}</td>
						<td>${record.unfs}</td>
						<td>${record.focus}</td>
						<td>${record.coor}</td>
						<td>${record.othr}</td>
						<td width="150" >${record.remk}</td>
						<%-- <td>${record.operator}</td>
						<td>${record.addTime}</td>
						<td>${record.del}</td> --%>

						<td><shiro:hasPermission name="/weekly/weekly/details">
								<a title="详情" target="dialog" href="${pageContext.request.contextPath}/weekly/weekly/details?id=${record.id}" class="detailsBtn" mask="true" width="820" height="460"><span>详情</span></a>
							</shiro:hasPermission> 
							
							<c:if test="${record.overdue <= 7}">
								<shiro:hasPermission name="/weekly/weekly/toUpdate">
									<a title="编辑" onclick="toWeekly('${requestScope.merchantEmployees.dmid}','${pageContext.request.contextPath}/weekly/weekly/toUpdate?id=${record.id}','update','编辑')" href="javascript:;" class="editBtn" ><span>编辑</span></a>
								</shiro:hasPermission>
								<shiro:hasPermission name="/weekly/weekly/delete">
									<c:if test="${record.del!=3}">
										<a title="确定要删除吗？" mask="true" target="ajaxTodo" href="${pageContext.request.contextPath}/weekly/weekly/delete?id=${record.id}" class="deleteBtn" mask="true"><span>删除</span></a>
									</c:if>
								</shiro:hasPermission>
							</c:if>
						</td>
					</tr>
				</c:forEach>
			</c:if>

		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>
<script type="text/javascript">
	function toWeekly(dmid, url, dlgId, title) {
		if (dmid) {
			$.pdialog.open(url, dlgId, title, {
				width : 820,
				height : 460,
				mask : true,
				resizable : true,
				drawable : false
			});
		} else {
			alertMsg.error('请先绑定部门！')
		}

	}
</script>